<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>

    <style>
        /*ul的第一个子元素*/
        ul li:first-child{
            background: green;
        }
        /*ul的最后一个子元素*/
        ul li:last-child{
            background: red;
        }
        body p:first-child{
            background: red;
        }
        p:hover{
            background: blue;
        }

    </style>

</head>
<body>

<p>p1</p>
<p>p2</p>
<p>p3</p>

<ul>
    <li>111</li>
    <li>222</li>
    <li>333</li>
    <li>444</li>
</ul>

</body>
</html>